package com.example.app1;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.TextView;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.example.app1.Util.DateUtil;

public class SendActivity extends AppCompatActivity {
    String sendStr="怀明，睡了吗";
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_send);
        TextView tv1 = findViewById(R.id.tv1);
        tv1.setText(sendStr);
        findViewById(R.id.btn1).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(SendActivity.this, RecvActivity.class);
                Bundle bundle=new Bundle();
                bundle.putString("sendtime", DateUtil.getTimeStr());
                Log.d("tang", "onClick: "+DateUtil.getTimeStr());
                bundle.putString("content",sendStr);
                intent.putExtras(bundle);
                startActivity(intent);
            }
        });
    }
}
